import request from '@/utils/request'
import { safetyApiUrl } from '@/api/config'

/**
 * 列表
 */
export function getList(data) {
    return request({
        url: safetyApiUrl + '/safety-star-cite/team/findList',
        method: 'post',
        data,
    })
}

/**
 * 统计
 */
 export function getTotal(data) {
    return request({
        url: safetyApiUrl + '/safety-star-cite/team/count',
        method: 'post',
        data,
    })
}

/**
 * 新增
 */
 export function addData(data) {
    return request({
        url: safetyApiUrl + '/safety-star-cite/team/createByMain',
        method: 'post',
        data,
    })
}

/**
 * 编辑
 */
 export function updateData(data) {
    return request({
        url: safetyApiUrl + '/safety-star-cite/team/editByMain',
        method: 'post',
        data,
    })
}

/**
 * 删除
 */
 export function deleteData(params) {
    return request({
        url: safetyApiUrl + `/safety-star-cite/team/deleteById/${params.id}`,
        method: 'get',
        params,
    })
}


/**
 * 详情
 */
 export function getDetail(params) {
    return request({
        url: safetyApiUrl + `/safety-star-cite/team/findById/${params.id}`,
        method: 'post',
        params,
    })
}

/**
 * 获取项目下分包人员
 */
export function getSubpersonByProject(params) {
    return request({
        url: safetyApiUrl + `/safety-star-cite/team/query`,
        method: 'get',
        params,
    })
}

/**
 * 获取项目下的班组
 */
 export function getTeamnByProject(params) {
    return request({
        url: safetyApiUrl + `/safety-star-cite/teamGroup/query`,
        method: 'get',
        params,
    })
}